@charset "utf-8";

// 定义group的基础构造
@mixin _group {
    position: absolute;
    top: map-get($group, top);
    right: 0;
    bottom: 0;
    left: 0;
    overflow: hidden;
    > .sticky,
    > .scroll-index {
        position: absolute;
        z-index: 1000;
        top: 0;
        right: 0;
    }
    > .sticky {
        left: 0;
        padding: map-get($list, label-padding);
        background-color: map-get($list, label-bgcolor);
        color: map-get($base, sub-color);
    }
    .no-data {
        @include align;
        text-align: center;
    }
}

/**
 * @module widget
 * @method yo-group
 * @version 1.0.0
 * @description 构造yo-group自定义使用方法
 * @demo http://doyoe.github.io/Yo/demo/widget/yo-group.html
 * @param {String} $name 定义扩展名称 <1.0.0>
 * @param {Length} $top 顶部偏移值 <1.0.0>
 */

@mixin yo-group(
    $name: default,
    $top: default) {
    // 区别是否新增实例还是修改本身
    $name: if($name == default, "", "-#{$name}");
    // 如果值为default，则取config的定义
    @if $top == default {
        $top: map-get($group, top);
    }
    .yo-group#{$name} {
        @if $top != map-get($group, top) {
            top: $top;
        }
        // 增量扩展
        @content;
    }
}

// 调用本文件时载入group基础构造
.yo-group {
    @include _group;
}